<?php
/**
 * SocialEngine
 *
 * @category   Application_Extensions
 * @package    Flashgame
 * @version    $Id: index.tpl 6755 2010 YouNet $
 * @author     To Anh
 */
?>
<h2><?php echo $this->translate("Games Plugin") ?></h2>

<?php if( count($this->navigation) ): ?>
  <div class='tabs'>
    <?php
      // Render the menu
      //->setUlClass()
      echo $this->navigation()->menu()->setContainer($this->navigation)->render()
    ?>
  </div>
<?php endif; ?>

  <div class='clear'>
    <div class='settings'>
    <form class="global_form">
        <?php if(count($this->packages)>0):?>
        <?php foreach ($this->packages as $package): ?>
        <h3><?php echo $package->package_name; ?></h3>
        <p class="description">
          <?php echo $package->package_description ?>
        </p>
         <table class='admin_table' width="400">
          <tbody>
            <tr>
              <td width="150"><?php echo $this->translate("Enable") ?></td>
              <td><?php if ($package->package_enabled) echo $this->translate("yes"); else echo $this->translate("No"); ?></td>
            </tr>
            <!--tr>
              <td><?php echo $this->translate("Associated Level") ?></td>
              <td>
                    <?php //foreach ($this->user_levels as $user_level): ?>
                        <?php //if ($package->package_level_id==$user_level->level_id) 
                                 // echo $user_level->getTitle(); 
                              //if ($package->package_downgrade_level_id==$user_level->level_id)
                                  //$package_downgrade_level_title =  $user_level->getTitle(); 
                        ?> 
                    <?php //endforeach; ?>
              </td>
            </tr-->
            <!--
            <tr>
              <td><?php //echo $this->translate("Downgrade Level") ?></td>                   
              <td>
                    <?php //if ($package_downgrade_level_title) echo $package_downgrade_level_title; ?>
              </td>
            </tr> 
            --> 
            <tr>
              <td><?php echo $this->translate("Plan Period") ?></td>
              <td><?php echo $package->package_period ?> <?php echo $this->periodtypes[$package->package_periodtype]; ?></td>
            </tr>
            <tr>
              <td><?php echo $this->translate("Recurring?") ?></td>
              <td><?php 
                        if ($package->package_recurring) 
                        {
                            echo $this->translate("Yes"); 
                            echo $package->package_recurring_cycles;
                        }
                        else echo $this->translate("No"); 
                        ?> 
              </td>
            </tr>
            <tr>
              <td><?php echo $this->translate("Price") ?></td>
              <td><?php echo $package->package_price  ?></td>
            </tr>
            <!--
            <tr>
              <td><?php //echo $this->translate("Initial price") ?></td>
              <td><?php //echo $package->package_onetime_price ?></td>
            </tr>
            -->
            <tr>
              <td><?php echo $this->translate("Sold") ?></td>
              <td><?php echo $package->package_sold ?></td>
            </tr>
            <tr>
                <td colspan="2" align="center">
                        <a href="admin/flashgame/package/create"><?php echo $this->translate("Add New Package") ?></a>
                        |
                        <a href="<?php echo $this->url(array('package_id' => $package->package_id), 'flashgame_admin_manage_package_edit') ?>"><?php echo $this->translate("edit") ?></a> |
                        
                        <?php echo $this->htmlLink(array('route' => 'admin_default', 'module' => 'flashgame', 'controller' => 'package', 'action' => 'delete', 'package_id' =>$package->package_id), $this->translate('delete'), array(
                        'class' => 'smoothbox',
                      )) ?>
                      </td>
            </tr>
            <?php endforeach; ?>
          </tbody>
        </table>
      <?php else:?>
      <br/>
      <div class="tip">
      <span><?php echo $this->translate("There are currently no packages.") ?></span>
      </div>
        <br/>
        <a href="admin/flashgame/package/create"><?php echo $this->translate("Add New Package") ?></a>
      <?php endif;?>
        
    </form>
    </div>
  </div>